//
//  MPTVideoBlendExportSession.h
//  MPTVideoKit
//
//  Created by Khazmovsky on 14/11/14.
//  Copyright (c) 2014年 Xuan Yi Xia CO.LTD. All rights reserved.
//

#import <AVFoundation/AVFoundation.h>

typedef NS_ENUM(NSInteger, MPTVBExportSessionStatus) {
    //    MPTVBExportSessionStatusUnknown,
    //    MPTVBExportSessionStatusWaiting,
    //    MPTVBExportSessionStatusExporting,
    MPTVBExportSessionStatusCompleted,
    MPTVBExportSessionStatusFailed,
    MPTVBExportSessionStatusCancelled
};

@class MPTVBMovie;
@class MPTVBExportSession;

@protocol MPTVideoBlendExportSessionDelegate <NSObject>

- (void)exportSession:(MPTVBExportSession *)exportSession exportingProgress:(CGFloat)exportingProgress;

@end

typedef id<MPTVideoBlendExportSessionDelegate> MPTVBESDelegate;
typedef MPTVBExportSessionStatus         MPTVVESStatus;

@interface MPTVBExportSession : NSObject

@property (nonatomic, strong) AVAsset            *asset;
@property (nonatomic, strong) AVVideoComposition *videoComposition;
@property (nonatomic, strong) AVAudioMix         *audioMix;
@property (nonatomic, strong) NSURL              *outputURL;
@property (nonatomic, strong) NSString           *fileType;
@property (nonatomic, assign) NSUInteger         bitRate;
@property (nonatomic, strong) NSDictionary       *videoOutputSettings;
@property (nonatomic, strong) NSDictionary       *audioOutputSettings;
@property (nonatomic, strong) NSArray            *videoEffect;
@property (nonatomic, assign) CMTimeRange        timeRange;
@property (nonatomic, weak  ) MPTVBESDelegate    delegate;
@property (nonatomic, assign) MPTVVESStatus      status;
@property (nonatomic, assign) CGSize      tarVidSize;

@property (nonatomic, strong) NSArray *arrangedSubtitleModels;
@property (nonatomic, assign) CGSize videoEditSize;
@property (nonatomic, strong) NSArray *commonMetadata;
@property (nonatomic, strong) NSDictionary *updatedValues;

@property (nonatomic, strong) NSArray *persistenceFilters;

@property (readonly) NSError *error;

- (id)initWithMPTMovie:(MPTVBMovie *)video;
- (void)exportAsynchronouslyWithCompletionHandler:(void (^)())handlder;
- (void)cancelExport;

@end
